package com.qingsong.dto;

import com.qingsong.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;


/** @author qingsong */
@Schema(name = "订单修改DTO")
@Data
public class OrderUpdateDTO implements Serializable, RE {

    @NotNull(message = "主键不能为空")
    @Schema(description = "主键")
    private Long id;

    /*@Schema(description = "用户ID：购买人的ID")
    private Long fkUserId;*/

    @DecimalMin(value = "0", message = "订单总金额不能小于0元")
    @Schema(description = "订单总金额")
    private Double totalAmount;

    @DecimalMin(value = "0", message = "订单实际支付总金额不能小于0元")
    @Schema(description = "订单实际支付总金额")
    private Double payAmount;

    @Range(min = 0, max = 4, message = "订单状态必须在0~4之间")
    @Schema(description = "订单状态")
    private Integer status;

    @Pattern(regexp = INFO_RE, message = INFO_RE_MSG)
    @Schema(description = "描述")
    private String info;

    @Schema(description = "优惠券ID：下单时使用的优惠券")
    private Long fkCouponsId;
}